Programming Languages Section

Pascal, Which one is it ?

Card image
Post by Amina Delali, November 7th, 2022

Some Facts

There are different dialects for the Pascal programming language. And these dialects were strongly influenced by the different compilers that were released during the development of the programming language. And also by the platforms for which it was developed. So you have the original Pascal called Standard Pascal, and you also have Delphi and Free Pascal. So the principal dialects are:

  • The language at first was simply imperative and procedural
  • Object Oriented extensions were added later, which generated a new language developed on its own called Object Pascal
  • Object Pascal was integrated and modified by Borland, and became later Delphi
  • Free Pascal based on Object Pascal, adds its own features and offers modes for compatibility with the other dialects.

So now, as the latest development of the programming language, you have Delphi the language and the software(a compiler and a RAD Studio IDE), and its free counterparts: Free Pascal and its corresponding RAD Studio IDE Lazarus

In the next section, we will continue with Free Pascal since it is more inclusive (compatibility modes with Delphi and other dialects), and it adds its own features.



How to install Free Pascal

    You can either install Free Pascal on its own, on both Windows and Ubuntu, or you can simply install the Lazarus IDE that will automatically install Free Pascal for you. Going with the second option, here is the instructions to install Lazarus on both systems:

  • on Windows: Simply go to Lazarus Download Page and select the version corresponding to your system. Download it, then follow the installation instruction (click the "Next" Button).
  • on ubuntu : The IDE is available and distributed by the Ubuntu Package Repository. So, all you have to do is:
    sudo apt update
    sudo apt install lazarus

    There is an other option, in which you can download the DEB packages from the previous download page and launch their installation. For more details, you can check this installation tutorial page.

The Hello World Example

A code block Pascal its identified by the Begin end keywords, and each program starts with the program keyword followed by the program's name.

The functions writeln will print the "Hello World!" message. And the function readln is used to let the program wait for you to press the Enter key before it closes , if you are running the program on an IDE. Because otherwise, it will run and close rapidly and automatically before you can see the results

program helloWorld;

begin
  writeln('Hello World!');
  readln;

end.



Side Notes

I made this graphic while working on the post, and trying to understand the differences between all the different dialects from the Pascal Language. I used information available in these two wiki links: page 1 and page 2

Additional Information

For more information about the Free Pascal language and the corresponding code, you can check the following pages:

Something to say ?

If you want to add something about the Pascal language or about this post, please feel free to do it by commenting below 🙂 .